<template>
	<view style="background-color: #F8F8F8; overflow-x: hidden;">
		<view style="background-color: #fff;">
			<top-heigth back-title="消息通知"></top-heigth>
		</view>
			
		<view class="content-box">
			<view class="notice-list" @click="toMessage">
				<view class="notice-list-l">
					<image src="/static/image/notice1.png" style="width: 90rpx; height: 90rpx;" mode=""></image>
					<view class="">系统消息</view>
				</view>
				<image src="/static/image/more.png" style="width: 40rpx; height: 40rpx;" mode=""></image>
			</view>
			<view class="notice-list" @click="tokefu" v-if="!isShenhe">
				<view class="notice-list-l">
					<image src="/static/image/notice2.png" style="width: 90rpx; height: 90rpx;" mode=""></image>
					<view class="">在线消息</view>
				</view>
				<image src="/static/image/more.png" style="width: 40rpx; height: 40rpx;" mode=""></image>
			</view>
		</view>
	</view>
</template>

<script>
	import TopHeigth from '@/components/TopHeigth.vue'
	import { checkLogin } from "@/util/checkLogin.js"
	import { TUIConversationService } from "@tencentcloud/chat-uikit-engine";
	
	export default {
		data() {
			return {
				isShenhe: 1
			}
		},
		components: { TopHeigth },
		onLoad() {
			uni.$u.http.post('/api/shop/v1_0/linyue/version',{}).then((res) => {
				this.isShenhe = !res.data
			})
		},
		methods: {
			toMessage(){
				checkLogin(() => {
					uni.navigateTo({
						url: "/pages/message/system"
					})
				})
				
			},
			tokefu(){
				checkLogin(() => {
					// 切换会话进入聊天
					const conversationID = `C2CLinYue`;
					// #ifdef APP-PLUS || H5
					TUIConversationService.switchConversation(conversationID);
					// #endif
					uni.navigateTo({
					  url: `/TUIKit/components/TUIChat/index?conversationID=${conversationID}`,
					});
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	@mixin flex($direction: row) {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: $direction;
	}
	.uv-nav-slot {
		@include flex;
		align-items: center;
		justify-content: space-between;
		border-width: 0.5px;
		border-radius: 100px;
		border-color: #dadbde;
		padding: 3px 7px;
		opacity: 0.8;
	}
	
	.notice-list{
		display: flex;
		align-items: center;
		justify-content: space-between;
		background-color: #fff;
		border-radius: 24rpx;
		padding: 32rpx 24rpx;
		margin-top: 24rpx;
		.notice-list-l{
			display: flex;
			align-items: center;
			justify-content: space-between;
			font-size: 30rpx;
			color: #333;
			image{
				margin-right: 16rpx;
			}
		}
	}
	
</style>
